package org.rain.core.querygen;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import lombok.AllArgsConstructor;
import org.rain.common.model.R;
import org.rain.core.querygen.token.QueryTokenizer;
import org.rain.core.querygen.token.Token;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Arrays;
import java.util.List;

/**
 * created by yangtong on 2025/4/6 下午5:31
 * <p>
 * 查询生成器接口
 */
@RestController
@RequestMapping("/core/querygen")
@AllArgsConstructor
@Tag(name = "查询生成器")
public class QueryGenController {

    @Autowired
    private List<AbsQueryCondition> queryConditions;

    @GetMapping("/test")
    @Operation(summary = "test", description = "test")
    public R<?> test(HttpServletRequest request, HttpServletResponse response) {
        QueryWrapper<Object> init = QueryWrapperGenerate.init(new Object());
        return R.success(init.getSqlSegment());
    }


}
